<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      console.log("四舍五入取整3.14", Math.round(3.14)); //四舍五入取整
      console.log("四舍五入取整3.54", Math.round(3.54)); //四舍五入取整

      console.log("向下取整3.14", Math.floor(3.14));
      console.log("向下取整3.54", Math.floor(3.54));

      console.log("向上取整3.14", Math.ceil(3.14));
      console.log("向上取整3.54", Math.ceil(3.54));
    </script>
  </body>
</html>
